﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PlanoTexturado;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Presentacion
{
    class DiapositivaImagen : Diapositiva
    {
        public string imagen;
        //private string mimetype;
        public Plano plano;
        public float escala;
        public Texture2D texture;
        public BasicEffect planoEffect;
        public GraphicsDeviceManager graphics;

        public DiapositivaImagen()
        {

        }
        public DiapositivaImagen(int index, string imagen, Texture2D texture)
        {
            this.index = index;
            this.escala = escala;
            this.imagen = imagen;
            this.texture = texture;
            this.plano = new Plano(new Vector3(index*2,-3,0), Vector3.Backward, Vector3.Up, 1, 1);

        }

        public void inicializarDiapositiva(GraphicsDeviceManager graphics, Matrix View, Matrix Projection)
        {
            this.graphics = graphics;
            planoEffect = new BasicEffect(graphics.GraphicsDevice);
            planoEffect.EnableDefaultLighting();

            planoEffect.World = Matrix.Identity;
            planoEffect.View = View;
            planoEffect.Projection = Projection;
            planoEffect.TextureEnabled = true;
            planoEffect.Texture = texture;
            planoEffect.Alpha = 0.5f;
        }

    }
}
